package com.fks.fks_service.mapper;


import com.fks.fks_service.pojo.ShopReleaseRecord;
import com.fks.fks_service.utils.ProxyCommissionRecordSql;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface ShopReleaseRecordMapper {

    @Insert("insert into fks_shop_release_record (title,shopId,updateStatus,editingType,updateTime" +
            ",editAccount,categoryName1,categoryName2,categoryName3)" +
            "values(#{title},#{shopId},#{updateStatus},#{editingType},#{updateTime}" +
            ",#{editAccount},#{categoryName1},#{categoryName2},#{categoryName3})")
    int addShopReleaseRecord(ShopReleaseRecord shopReleaseRecord);

    @SelectProvider(type = ProxyCommissionRecordSql.class, method = "getShopReleaseRecord")
    List<ShopReleaseRecord> getShopReleaseRecord(@Param("id") String id, @Param("title") String title
            , @Param("updateStatus") String updateStatus, @Param("newOldDegree") String newOldDegree
            , @Param("categoryName") String categoryName, @Param("page") String page, @Param("pageSize") String pageSize
            , @Param("editingType") String editingType,@Param("merchantUserId") int merchantUserId);

    @SelectProvider(type = ProxyCommissionRecordSql.class, method = "getShopReleaseRecordNumber")
    int getShopReleaseRecordNumber(@Param("id") String id, @Param("title") String title
            , @Param("updateStatus") String updateStatus, @Param("newOldDegree") String newOldDegree
            , @Param("categoryName") String categoryName
            , @Param("editingType") String editingType,@Param("merchantUserId") int merchantUserId);
}
